﻿<%@ Page Title="Parcelas de Turmas" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="GerarParcelasTurma.aspx.cs" Inherits="AcadPosApp.ControlarMatricula.GerarParcelasTurma" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style2
        {
            width: 311px;
        }
        .style4
        {
            width: 309px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consultas de Cursos">
        <table class="form-inline">
            <tr>
                <td class="style2">
                    Áreas de Conhecimento
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:DropDownList ID="ddlAreaConhecimento" runat="server" Width="300px" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlAreaConhecimento_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Descrição
                </td>
                <td style="font-weight: 700">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:TextBox ID="txtPesquisa" runat="server" MaxLength="250" Width="300px" required="required" ></asp:TextBox>
                    <!-- <asp:RequiredFieldValidator ID="requiredPesquisa" runat="server" ControlToValidate="txtPesquisa"
                        ErrorMessage="É necessário preencher o campo pesquisa!" ForeColor="Red" ValidationGroup="pesquisa"
                        SetFocusOnError="True">*</asp:RequiredFieldValidator> -->
                </td>
                <td>
                    <asp:Button ID="btnConsultar" runat="server" OnClick="btnConsultar_Click"
                        Text="Consultar" ValidationGroup="pesquisa" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwPesquisa" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
            DataKeyNames="ID_CURSO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
            Width="45%" OnRowDataBound="gvwPesquisa_RowDataBound" AllowPaging="True" OnPageIndexChanging="gvwPesquisa_PageIndexChanging"
            OnSelectedIndexChanged="gvwPesquisa_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                    <ItemStyle Width="1%" />
                </asp:CommandField>
                <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DESCRICAO" HeaderText="Cursos">
                    <ItemStyle HorizontalAlign="Left" Width="75%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                    <ItemStyle Width="10%" HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <table class="form-inline">
            <tr>
                <td>
                    Currículo
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <asp:DropDownList ID="ddlCurriculoPesquisa" runat="server" AutoPostBack="True" Enabled="false"
                        OnSelectedIndexChanged="ddlCurriculoPesquisa_SelectedIndexChanged" 
                        Width="150px">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <br />
        <table>
            <tr>
                <td class="style4">
                    Estado
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style4">
                    <asp:DropDownList ID="ddlEstadoPesquisa" runat="server" OnSelectedIndexChanged="ddlEstadoPesquisa_SelectedIndexChanged"
                        Width="150px" AutoPostBack="True">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style4">
                    Polo
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style4">
                    <asp:DropDownList ID="ddlPoloPesquisa" runat="server" Enabled="False" Width="300px"
                        AutoPostBack="True" 
                        OnSelectedIndexChanged="ddlPoloPesquisa_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:Button ID="btnConsultarTurmas" runat="server" formnovalidate="formnovalidate"
                        Text="Consultar" ValidationGroup="pesquisa" 
                        OnClick="btnConsultarTurmas_Click" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwPesquisaTurmas" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
            DataKeyNames="ID_TURMA, ID_CURRICULO, ID_POLO, ID_PROFISSIONAL" EmptyDataText="Dados não localizados..."
            GridLines="Vertical" OnRowDataBound="gvwPesquisaTurmas_RowDataBound" AllowPaging="True"
            OnPageIndexChanging="gvwPesquisaTurmas_PageIndexChanging" Width="60%" 
            onselectedindexchanged="gvwPesquisaTurmas_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                    <ItemStyle Width="1%" />
                </asp:CommandField>
                <asp:BoundField DataField="CURRICULO" HeaderText="Currículo">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DESCRICAO_MODULO" HeaderText="Módulo">
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Left" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="COD_TURMA" HeaderText="Turma">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="QTD_PARCELAS" HeaderText="Qtde Parcelas">
                    <HeaderStyle HorizontalAlign="Center" Width="5%" />
                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                </asp:BoundField>
                <asp:BoundField DataField="VALOR" HeaderText="Valor" DataFormatString="{0:c}">
                    <HeaderStyle HorizontalAlign="Center" Width="3%" />
                    <ItemStyle HorizontalAlign="Center" Width="3%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_INICIO" HeaderText="Data Início">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="DATA_FIM" HeaderText="Data Fim">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>
                <asp:BoundField DataField="NOME_PROFISSIONAL" HeaderText="Coordenador">
                    <HeaderStyle HorizontalAlign="Center" Width="10%" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Status">
                    <ItemTemplate>
                        <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                    <ItemStyle Width="5%" HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <div>&nbsp;&nbsp; <asp:Button ID="btnIncluir" runat="server" Text="Incluir" formnovalidate="formnovalidate"
            Visible="false" onclick="btnIncluir_Click" Width="100px" />
        </div><br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlParcelasRestantes" runat="server" GroupingText="Gerar Parcelas Restantes"
        Visible="False">
        <table class="form-inline">
            <tr>
                <td>
                    Data Primeiro Vencimento
                </td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="txtData1Vencimento" required runat="server" Height="30px" MaxLength="10"
                        Width="150px"></asp:TextBox>
                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True" TargetControlID="txtData1Vencimento">
                    </asp:CalendarExtender>
                </td>
            </tr>
        </table>
        <br />
        <div class="legenda">
            <asp:Button ID="btnConfirmarGerar" runat="server" Text="Confirmar"  
                OnClientClick="return ShowConfirm('Tem certeza que deseja continuar?', 'btnConfirmarGerar');" 
                ClientIDMode="Static"  OnClick="btnConfirmarGerar_Click" Width="100px" />
            &nbsp;<asp:Button ID="btnCancelarGerar" formnovalidate="formnovalidate" 
                runat="server" ClientIDMode="Static"
                Text="Cancelar" OnClick="btnCancelarGerar_Click" Width="100px" />
        </div><br />
    </asp:Panel>
    <asp:ValidationSummary ID="VSPesquisa" runat="server" ShowMessageBox="True" ShowSummary="False"
        ValidationGroup="pesquisa" />
</asp:Content>
